<?php
    $time = time();
    Header('Content-Type: text/xml');

     function toString($value)
     {
         return "$value";
     }

     function array2xml_text($array)
     {
         $res = '';
         foreach ( $array as $key => $value ) {
             $res .=
                 '<row ' . ( is_integer($key) ? 'index="'.$key.'"' : 'key="'.htmlentities(toString($key)).'"' ) . '>' .
                     (is_array($value) ? array2xml_text($value) : htmlentities(toString($value))) .
                 '</row>';
         }
         return $res;
     }
?>
<?='<?xml version="1.0" encoding="UTF-8"?>'."\n"?>
<root>
<server>
<?php

$server = array ();
foreach ( $_SERVER as $key => $value ) {
     if (strpos($key, 'HTTP_') !== 0) {
         continue;
     }
     if (is_string($value) && (strpos($value, ',') !== false)) {
         $value = explode(',', $value);
     }
     $server[$key] = $value;
}
echo array2xml_text($server);

?>
</server>
<datetime>
     <date>
         <year><?=date('Y', $time)?></year>
         <month><?=date('m', $time)?></month>
         <day><?=date('d', $time)?></day>
     </date>
     <time>
         <hour><?=date('H', $time)?></hour>
         <minute><?=date('i', $time)?></minute>
         <second><?=date('s', $time)?></second>
     </time>
</datetime>
</root>